package com.example.goods.controller;

import com.alibaba.fastjson.JSONObject;
import com.example.commons.filter.RequestFilter;
import com.example.commons.response.ResponseResult;
import com.example.commons.response.ResultCode;
import com.example.goods.service.ArticleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/article")
@Slf4j
public class ArticleController {
    @Autowired
    ArticleService articleService;

//    @PostMapping("/query/all")
//    @PreAuthorize("hasAuthority('qry')")
//    public ResponseResult queryAllGoods(RequestFilter requestFilter, ResponseResult result) {
//        JSONObject bodyJson = requestFilter.getRequestBodyJson();
//        Object[] objects = articleService.selectArticleByShow(bodyJson.getIntValue("page"), bodyJson.getIntValue("size"));
//        result.setCode(ResultCode.SUCCESS);
//        result.getData().put("pages", objects[0]);
//        result.getData().put("total", objects[1]);
//        result.getData().put("list", objects[2]);
//        return result;
//    }
}
